package com.chengqs.rainbow.im.client.retry;

import com.chengqs.rainbow.common.protobuf.Command;
import com.chengqs.rainbow.im.client.listener.CommandListener;

import java.util.concurrent.DelayQueue;

/**
 * <B>主类名称：</B>AbstractRetryExecutor<BR>
 * <B>概要说明：</B>enter<BR>
 *
 * @author: chengqs
 * @create: 2025-09-14 20:15:40
 **/
abstract class AbstractRetryExecutor<T> implements RetryExecutor<T> {

    /**
     * 延迟队列
     */
    protected final DelayQueue<DelayTask<T>> queue = new DelayQueue<>();

    protected volatile boolean running;

    public abstract void start();

    public void stop() {
        running = false;
    }

    public abstract void enqueue(Command command, T data, CommandListener failedListener);
}
